// 引入工具类
import axios from '../config'

// 使用
const URL = 'api-ca' // 公共前缀地址
export const caPubDriver = {
	//动因库
	pubDriverQuery(data) {
		return axios.post(URL + '/ca/pubDriver/query', data)
	},

	pubDriverToForm(data) {
		return axios.post(URL + '/ca/pubDriver/toForm', data)
	},

	pubDriverSave(data) {
		return axios.post(URL + '/ca/pubDriver/save', data)
	},

	pubDriverCheckIsRemove(data) {
		return axios.post(URL + '/ca/pubDriver/checkIsRemove', data)
	},

	pubDriverValidateDriverCode(data) {
		return axios.post(URL + '/ca/pubDriver/validateDriverCode', data)
	},

	pubDriverRemove(data) {
		return axios.post(URL + '/ca/pubDriver/remove', data)
	},

	pubDriverQueryRef(data) {
		return axios.post(URL + '/ca/pubDriver/queryRef', data)
	},
	pubDriverQueryList(data) {
		return axios.post(URL + '/ca/pubDriver/queryList', data)
	},
	//=========================================================================================
	//业务数据迁移
	getExportFile(data, loading = false) {
		return axios.post(
			URL + '/ca/pubDataManager/getExportFile',
			data,
			loading
		)
	},
	importFile(data, loading = false) {
		return axios.fileUpload(URL + '/ca/pubDataManager/importFile', data, loading)
	},
	exportFile(data, loading = false) {
		return axios.exportFile(URL + '/ca/pubDataManager/getExportFile', data, loading)
	},
	getPrograssMsg(data, loading = false) {
		return axios.post(
			URL + '/ca/pubDataManager/getPrograssMsg',
			data,
			loading
		)
	},
	//=========================================================================================
	//结果追溯
	queryList(data) {
		return axios.post(URL + '/ca/ruleScene/queryList', data)
	},
	//追溯费用来源和去向概况
	queryReview(data) {
		return axios.post(URL + '/ca/ruleFeeReview/queryReview', data)
	},

	queryReviewDetailPre(data) {
		return axios.post(URL + '/ca/ruleFeeReview/queryReviewDetailPre', data)
	},
	queryReviewDetailNext(data) {
		return axios.post(URL + '/ca/ruleFeeReview/queryReviewDetailNext', data)
	},

	//=========================================================================================
	//数据表查询
	phyTableQueryList(data) {
		return axios.post(URL + '/ca/pubSearchTemplate/queryList', data)
	},
	//根据模板ID获得页面展示查询组件信息
	queryInputsByTempId(data) {
		return axios.post(URL + '/ca/pubSearchTemplate/queryInputsByTempId', data)
	},
	
	//查询数据表中的数据
	queryPhyData(data) {
		return axios.post(URL + '/ca/pubSearchTemplate/queryPhyData', data)
	},
	//保存模板信息
	saveSearchTemplate(data) {
		return axios.post(URL + '/ca/pubSearchTemplate/save', data)
	},
	//检查模板名称是否重复
	checkSearchTemplateName(data) {
		return axios.post(URL + '/ca/pubSearchTemplate/checkSearchTemplateName', data)
	},
	//删除模板
	removeSearchTemplate(data) {
		return axios.post(URL + '/ca/pubSearchTemplate/remove', data)
	},
	//设为默认
	updateDefault(data) {
		return axios.post(URL + '/ca/pubSearchTemplate/update2Default', data)
	},
	//编辑模板时查询信息
	getInfo(data) {
		return axios.post(URL + '/ca/pubSearchTemplate/getInfo', data)
	},
	//=================================================================================
	//数据表查询导出
	exportSearchTable(data,loading= false) {
		return axios.exportFile(URL + '/ca/pubCaExcel/exportSearchTable', data,loading)
	},

}
